Skip to content

feat(playwright): integrate campaign preview tests into e2e suite and… - #720

Open
cmullenx wants to merge 5 commits into
webex:nextfrom
cmullenx:chrmulle/campaigne2e
Open

feat(playwright): integrate campaign preview tests into e2e suite and…#720
cmullenx wants to merge 5 commits into
webex:nextfrom
cmullenx:chrmulle/campaigne2e

Conversation

@cmullenx

@cmullenx cmullenx commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

COMPLETES # https://jira-eng-sjc12.cisco.com/jira/browse/CAI-7836

This pull request addresses

Adds e2e tests for campaigns

by making the following changes

adding e2e tests and integrating them into the suite

Screenshot 2026-07-22 at 3 20 40 PM

i have run the code review here: https://agenticai-quality-assurance.cisco.com/scan/f7644d83bbb6800c/report.html?t=sXGlRWod0B1DSr7-fiKfpsCuZoiwiJkPpv29GIECytg&exp=1786990434903&u=Y2lzY29zcGFyazovL3VzL1BFT1BMRS9mNDUxZGQ0Ni01NjJjLTQyOGUtYTA5OC02MzNkMTFlZDdmNGE

Change Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tooling change
  • Internal code refactor

The following scenarios were tested

  • The testing is done with the amplify link
    < ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >

The GAI Coding Policy And Copyright Annotation Best Practices

  • GAI was not used (or, no additional notation is required)
  • Code was generated entirely by GAI
  • GAI was used to create a draft that was subsequently customized or modified
  • Coder created a draft manually that was non-substantively modified by GAI (e.g., refactoring was performed by GAI on manually written code)
  • Tool used for AI assistance (GitHub Copilot / Other - specify)
    • Github Copilot
    • Other - Windsurf
  • This PR is related to
    • Feature
    • Defect fix
    • Tech Debt
    • Automation

Checklist before merging

  • I have not skipped any automated checks
  • All existing and new tests passed
  • I have updated the testing document
  • I have tested the functionality with amplify link

Make sure to have followed the contributing guidelines before submitting.

… add coverage

Wire campaign preview Playwright tests into the contact center e2e runner
and add 9 new tests covering previously untested component behavior.

Infrastructure:
- constants.ts: add CAMPAIGN_TEST_IDS with all 21 data-testid values from
  the CampaignTask component tree (task, list item, title, phone, actions,
  buttons, expanded area, popover, countdown, global variables, error dialog)
- test-manager.ts: add setupForCampaignPreview() — single agent, desktop
  login, console logging (campaign tests inject mock tasks via page.evaluate)
- test-data.ts: add SET_10 with TEST_SUITE pointing to
  campaign-preview-tests.spec.ts so playwright.config.ts auto-discovers it

Utility enhancement:
- campaignPreviewUtils.ts: extend stubCampaignPreviewActions to support
  'cancel' failAction (stubs task.end() to reject), add cancel tracking to
  getCampaignActionCounts return type

New test coverage (9 tests across 6 describe blocks):
- Cancel Error: cancel failure shows error dialog with correct title,
  dismiss re-enables cancel button
- Button Disabled Combinations: both skip and remove disabled simultaneously,
  accept remains enabled
- Countdown Display: countdown timer renders when timeout timestamp is set
- Fallback Title: empty customer name falls back to ANI as title, phone
  subtitle hidden when it equals the title
- Error Dialog Content: verifies correct error title text for accept, skip,
  and remove failures (3 tests)
- Re-offer After Skip: simulated new contact (changed timeout) resets all
  buttons to enabled state

Total campaign preview test count: 22 existing + 9 new = 31 tests
@cmullenx
cmullenx requested a review from a team as a code owner July 17, 2026 12:46
@cmullenx cmullenx added validated Indicates that the PR is ready for actions run_e2e Add this label to run E2E test for meeting and CC widgets labels Jul 17, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a51b79c540

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread playwright/tests/campaign-preview-test.spec.ts Outdated
@aws-amplify-us-east-2

Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-720.d1b38q61t1z947.amplifyapp.com

@github-actions github-actions Bot removed the validated Indicates that the PR is ready for actions label Jul 22, 2026
@cmullenx cmullenx added the validated Indicates that the PR is ready for actions label Jul 22, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b6435cc252

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread playwright/Utils/campaignPreviewUtils.ts Outdated
@github-actions github-actions Bot removed the validated Indicates that the PR is ready for actions label Jul 22, 2026

@brain-frog brain-frog left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@cmullenx cmullenx added the validated Indicates that the PR is ready for actions label Jul 23, 2026
@github-actions github-actions Bot removed the validated Indicates that the PR is ready for actions label Aug 17, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5fc6b4e8d4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread playwright/test-data.ts
CHAT_URL: `${env.PW_CHAT_URL}-e2e-10.html`,
EMAIL_ENTRY_POINT: `${env.PW_SANDBOX}.e2e10@gmail.com`,
ENTRY_POINT: env.PW_ENTRY_POINT10,
TEST_SUITE: 'campaign-preview-tests.spec.ts',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Document the newly activated Playwright set

Adding SET_10 activates a new suite and also introduces a setup flow, shared helpers, constants, and stability constraints, but the commit updates no Playwright standing documentation. The routed Playwright guidance explicitly makes documentation alignment mandatory for changes to suites, sets, or setup flows; update the current Playwright architecture/baseline documentation in this same change so the documented suite-to-set mapping and cleanup behavior remain authoritative.

AGENTS.md reference: AGENTS.md:L68-L68

Useful? React with 👍 / 👎.

…d of prototype

refreshTaskList is a bound class field (own property), not a prototype
method. The previous restoreRefreshTaskList read from the prototype
where it was always undefined, making the restore a silent no-op.

Now stubRefreshTaskList saves the original on window before overwriting,
and restoreRefreshTaskList restores from that saved reference.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1ddc155e93

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

// The inline card uses timerDisplayMode=handle-time, so countdown only appears in popover.
// Check the campaign-countdown element directly
const countdown = testManager.agent1Page.getByTestId(CAMPAIGN_TEST_IDS.COUNTDOWN).first();
await expect(countdown).toBeAttached({timeout: 5000});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Open the popover before checking the countdown

This assertion only checks DOM attachment even though the countdown is rendered inside a popover configured to open on mouseenter. Without hovering the campaign task, the test passes while the countdown remains hidden, so regressions that prevent users from seeing it are not detected. Hover the trigger and assert that the countdown is visible, ideally also checking its displayed value.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run_e2e Add this label to run E2E test for meeting and CC widgets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants